//
//  SMHHomeViewController.swift
//  SMHCommerce
//
//  Created by lvzhao on 2020/1/6.
//  Copyright © 2020 lvzhao. All rights reserved.
//

import UIKit
import SnapKit
import SwiftyFitsize
import PKHUD
import SwiftyJSON
import RxCocoa
import RxSwift

class SMHHomeViewController: LZBaseViewController {
    


    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.setupUI()
    
        // Do any additional setup after loading the view.
    }
  
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.viewModel.getHomeData(isFrist: true)
    }
    
   //MARK:setupUI加载UI
   func setupUI()  {
       
       self.view.addSubview(self.homeView)
       self.homeView.snp.makeConstraints { (make) in
           make.edges.equalTo(0)
       }
   }

       
       
   //MARK:懒加载
   lazy var  viewModel: SMHHomeViewModel = {
       let viewModel = SMHHomeViewModel()
       return viewModel
   }()
   
   
   lazy var homeView: SMHHomeView = {
       let homeView = SMHHomeView.init(viewModel: self.viewModel)
       return homeView
   }()
    

    
    /*
    // MARK: - Navigation
     bgImageView.snp.makeConstraints { (make) in
          make.left.bottom.right.equalTo(self)
          make.top.equalTo(-20)
      }
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
